#

| Chapter 41 Terminal and Serial Line Settings |

## 41.6 Using sleep to Keep Port Settings

It's sometimes desirable to use stty (41.3) to set values for a serial port other than the one your tty may be on (for example, a printer or modem port). But without a program "hanging on to" a port, the settings are pretty much useless in many UNIXes. A tty that is not attached to a process typically gets reset to some default whenever you open it. The only way to set it some way and make it stay that way is to open it and hold on to it, then set the modes.

The standard trick is to use:

>     % sleep 1000000 > /dev/ttyXX &

before setting things up. You can kill (38.10) the sleep (40.2) later, when you are done.

- CT in net.unix on Usenet, 30 January 1984

41.5 Why Some Systems Backspace over Prompts |  | 41.7 Reading Verrrry Long Lines from the Terminal